import Home from "../layout/Home.vue";

/**
 * 管理员后台页面（控制台路由）
 * 1、管理员和用户是同一个控制台
 *    通过meta.isAdmin: true, // 仅管理员可见
 * icon 菜单栏的小图标
 * title 标题
 */
export default {
    path: "/admin",
    name: "admin",
    redirect: "/dashboard",
    component: Home,
    children: [
        {
            path: "/dashboard",
            name: "dashboard",
            meta: {
                title: '系统首页',
                icon: "s-home"
            },
            component: () => import ( /* webpackChunkName: "base" */ "../views/Dashboard.vue")
        }, {
            path: "/cate",
            name: "cate",
            meta: {
                title: '分类管理',
                icon: "lx-cascades",
                role: "admin", // 仅管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/category/Cate.vue")
        }, {
            path: "/course",
            name: "course",
            meta: {
                title: '课程管理',
                icon: "lx-calendar",
                role: "teacher", // 仅教师可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/course/Course.vue")
        }, {
            path: '/member',
            name: 'member',
            meta: {
                title: '学生管理',
                icon: "user-solid",
                role: "admin", // 仅管理员可见
            },
            component: () => import (/* webpackChunkName: "admin" */ '../views/member/Member.vue')
        }, {
            path: '/teacher',
            name: 'teacher',
            meta: {
                title: '教师管理',
                icon: "lx-profile",
                role: "admin", // 仅管理员可见
            },
            component: () => import (/* webpackChunkName: "admin" */ '../views/member/Teacher.vue')
        }, {
            path: "/news",
            name: "news",
            meta: {
                title: '新闻管理',
                icon: "lx-newsfill",
                role: "admin", // 仅管理员可见
            },
            component: () => import ( /* webpackChunkName: "admin" */ "../views/news/News.vue")
        },
        {
            path: '/orders',
            name: 'orders',
            meta: {
                title: '课程预约',
                icon: "lx-remind",
                role: ['teacher', 'student'], // 学生、教师可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/orders/Orders.vue')
        },
        {
            path: '/resource',
            name: 'resource',
            meta: {
                title: '资料库',
                icon: "lx-file",
                role: "teacher", // 仅教师可见
            },
            component: () => import (/* webpackChunkName: "admin" */ '../views/resource/Resource.vue')
        },
        {
            path: '/user',
            name: 'user',
            meta: {
                title: '个人中心',
                icon: "lx-addressbook",
                role: ['teacher', 'student'], // 学生、教师可见
            },
            component: () => import (/* webpackChunkName: "base" */ '../views/User.vue')
        },
        // {
        //     path: "/icon",
        //     name: "icon",
        //     meta: {
        //         icon: "lx-emojifill",
        //         title: '自定义图标'
        //     },
        //     component: () => import ( /* webpackChunkName: "icon" */ "../views/Icon.vue")
        // },

    ]
}
